home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK2.toast / Development Kits (Disc 2) / ScriptX / Documentation / Code Examples from Docs / langguid / chap_03 / xmpl_02.sx < prev    next >
Encoding:
Text File  |  1996-05-21  |  661 b   |  31 lines  |  [TEXT/ttxt]

  1. --<<<
  2. -- Kaleida Labs, Inc.
  3. -- Field Guide to the ScriptX Language
  4. -- chapter 3, example 2
  5.  
  6. -- create a module to avoid naming conflicts
  7. module Scratch11 uses ScriptX end
  8. in module Scratch11
  9.  
  10. -- declare all globals used in these examples
  11. global myLine, myRectangularShape
  12.  
  13. -- variable access
  14.  
  15. myLine := new Line x1:10 y1:10 x2:65 y2:65
  16. myLine.x1 
  17. myLine's y1 
  18. myLine.y2 < myLine.y1
  19.  
  20. object myRectangularShape (TwoDShape)
  21.     stroke:blackBrush, boundary:(new Rect x2:100 y2:100)
  22. end
  23. myRectangularShape's boundary's x2
  24. myRectangularShape.boundary.x2 
  25.  
  26. myLine := new Line x1:10 y1:10 x2:65 y2:65
  27. myLine's x1 := 0
  28. myLine's y1 := 0
  29. myLine.x2 := 10
  30. myLine.y2 := 10
  31. -->>>